package com.jrx.mservices.ribbon.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

/**
 * 消费服务类
 *
 * @author zwg
 * @create 2018-03-06 17:32
 */
@Service
public class RibbonService {

    public static final Logger logger = LoggerFactory.getLogger(RibbonService.class);

    @Autowired
    private RestTemplate restTemplate;

    public String callProvideTestFunc(){
        String result = restTemplate.getForEntity("http://provide-eureka/provide/test",String.class).getBody();
        logger.info("callProvideTestFunc result:{}",result);
        return result;
    }

}
